The Liberty Basic Newsletter - Issue #119 - APRIL 2004 
Please download the Zip Archive for this issue to get all associated files.
"Just because something doesn't do what you planned it to do doesn't mean it's useless." - Thomas Edison
In this issue:
Exciting Stuff! A Forum Post From Carl:
[http://libertybasic.conforums.com/]
Here's my reaction to the message thread "How many features is too many?"
I have always had the attitude that Liberty BASIC needs to be as simple as possible. This is important for the beginner and the expert. Adding user functions and subs is the way to extend a small language. I don't think we're all the way there yet. Some more flexibility is needed in the calling convention. Probably we also need types (or something like types).
I don't like the syntax for controlling named objects like files and widgets. The #handle "command blah blah" syntax isn't ideal. I will try to improve this.
Liberty BASIC also needs support for code libraries. Whether this takes the form of an include statement or something more powerful is a matter I haven't worked out yet.
I have hinted a few times recently that there will be a second BASIC language from the creators of Liberty BASIC (I am not the only coder now), and I say so more explicitly now. Liberty BASIC will continue to be Liberty BASIC, and a new BASIC will be born that will give us the flexibility to break the backwards compatibility shackles. New technology is being designed. Some of it will be used to enable Liberty BASIC 5, and this new software technology will form the core of the new language. More information about our plans for the new BASIC will be made available after the LB5 alpha is released.
As for innovation in Liberty BASIC itself, there will surely be some new commands, but my principle focus will be to improve the IDE itself. A LOT of room for improvement exists in this space. The tools should be just as simple and easy to use, with added power on demand.
I intend to break the mold with our upcoming releases. I don't want to copy what other programming language vendors do. I will try to create a version of BASIC that does cool stuff that comes from thinking outside the box. I already have a lot of ideas about this, but I'm not going to reveal what my ideas are until I actually have some of them implemented.
- Carl
Notes from the Editor:
This month's quote is by Thomas Edison. He has appeared here before to guide us, so I guess my respect for him is not a secret! I first came to be fascinated by Edison when I was a young child on a class field trip. I stood inside his Menlo Park lab, which had been moved to Greenfield Village by Henry Ford. [http://www.hfmgv.org/exhibits/edison/default.asp] I listened to the first phonograph recording. It was Edison himself, reading "Mary had a little lamb." The lab looked so crude! It was hard to believe that any significant work could be done in a building that looked like little more than an old barn! The class also learned about the large number of attempts make by Edison to find a substance to use as a lightbulb filament. No wonder Edison declared that genius is 1% inspiration and 99% perspiration! Edison was actually working on the telephone when he made some discoveries that led to the invention of the phonograph. When we are writing code and something doesn't work the way we planned, we should stop and see what it does accomplish! Many of us have discovered wonderful coding tricks "by accident!"
Programmers often request more API information in Liberty BASIC. The Windows API consists of more than 1500 functions, so it isn't feasible to make this a native part of Liberty BASIC, as some people ask. As an alternative, we issued a challenge on the LB forum. [http://libertybasic.conforums.com/] The challenge was to create an API viewer that would open a list of Visual Basic API declarations provided by Microsoft and translate them into LB syntax. Colin McMurchie met this challenge beautifully, and his API viewer is included in this issue!
This month, Jim Brossman follows up on his article on RTF help for our programs. He shows us how to expand on this idea and provide individual help for each of our program windows. What a good idea!
In his article "Real Time Communication Under Windows," Peter Hawken lays to rest the notion that Liberty BASIC is not for use in serious programs. Peter gives us a detailed article on his use of LB's serial communications abilities to interface with microcontrolers for a very important, real world application. His program tests equipment for law enforcement agencies. He provides an in-depth discussion of microcontrolers and ends on this delightful note: "Once the basic data input software is created, the possibilities are almost endless for new applications. From my own point of view, as a gadget man, I am tempted to monitor and record everything for which I can find a sensor or transducer. My wife tells me that I am not allowed to strap an accelerometer to the family cat to record how fast and high she jumps during the day. Feline activities aside, the use of a microcontroller as an interface to the real world creates opportunities that until recently were difficult and expensive to implement. A look at the sensor and transducer section of any component catalogue will generate ideas to swamp even the most prolific programmer."
Brad Moore enjoyed the multiple slider demo by Mike Bradbury in the previous issue, and this month he shares an updated slider control of his own. This one is sprite based! Brad takes the time to explain the complexities of the code, which he updated from a demo by one of the pioneers in the Liberty BASIC online community, Ryan Jeffords. Thanks, Brad!
Gordon Rahman shares his solution to the problem of creating desktop shortcuts. Although some folks have used flawed work-arounds in the past, this method should work properly for everyone. Thanks for sharing this, Gordon. I'm sure it will go into everyone's toolbox!
Ben E. has announced the release of a new visual GUI designer called Quick Visual Designer. It has an interface that more closely resembles Visual Basic than Freeform. Read a review in this issue. If you haven't found a GUI designer that suits your style, this might be the one for you.
"A Dozen Rules for Writing Code" comes from my own experience in coding. If you have other rules, please write an article and submit it so that we can all improve our coding habits!
The Tip Corner this month discusses the use of DATA statements and it explains how to use them effectively with arrays. This article was suggested by a reader. If there are subjects that you think should be covered, please make your suggestions at the feedback board: [http://libertybasic.conforums.com/index.cgi?board=feedback]
Liberty BASIC provides quite a lot of graphics features, but there are some graphics objects that aren't provided by native graphics commands. One of these is the polygon. There has been a lot of talk of polygon drawing lately, and some members of the forum requested that I share my methods for drawing filled polygons, so it is included in this issue. I hope you enjoy the tutorial and demos. There is even a cute demo that allows the user to click points in a graphicbox to designate vertices of a triangle. (It is certainly not up to Tom Nally's standards for math and graphics, but it is kind of amusing anyway.)
We've seen many requests on the forums lately for methods to allow a user to control a sprite. This issue contains the first in a series of "Sprite Bytes." Sprite Bytes will be a series of methods to use in sprite and game programming. Each one will target a single, useful method. For comprehensive instructions on writing games, see the honored game tutorial series in this newsletter by Richard Ryles. The first Sprite Byte shows how to move a sprite around the screen with keyboard input.
This month, Gordon Sweet shares an executable he created that provides access to DOS commands from within our programs. He also shares his Morse Code Tutor. Thanks, Gordon, for sharing more of your wonderful demos!
We sometimes grouse about the lack of certain abilities in LB programming, but we forget that some of these things can be done quite easily from within LB by the use of BAT (batch) files. Scott Bannon gives us a gentle reminder this month and provides a demo that pings a website by using a batch file. Good stuff!
We've also had some requests for a demonstration of a multi-column listbox, so I've provided a program with some instructions. This is an "LB4 only" program that makes use of the great, new STYLEBITS command. I hope you see the value of reader input for those of us who create the newsletter. It is wonderful to know what our readers want to see! Thanks to all of you, and please keep those comments and suggestions coming!
- Alyce Watson
The Liberty BASIC Newsletter encourages all LB programmers to submit articles for publication. Everyone has something valuable to say, from beginners to veteran LBers. Consider sharing a code routine, with explanation. Perhaps you can review a favorite LB website, or program, or coding tool? Why not submit a list of questions that have been nagging at you? How about sharing your favorite algorithm?
The Publishing Team:
Alyce Watson: alycewatson@charter.net
Brad Moore: ymail@copiasystems.com
Tom Nally: SteelWeaver52@aol.com
Carl Gundel: carlg@libertybasic.com
Bill Jennings: bbjen@bigfoot.com
This newsletter was produced with WikiWriter, http://hytext.com/ww
No part of this newsletter may be reproduced or published in another location without the expressed, written consent of the publishers.
Individual authors retain copyrights to their works.